<!--header start-->
      <header class="header black-bg">
              <div class="sidebar-toggle-box">
                  <div class="fa fa-bars tooltips" data-placement="right" data-original-title="收缩菜单"></div>
              </div>
            <!--logo start-->
            <a href="#" class="logo"><b>自制后台</b></a>
            <!--logo end-->
            <div class="nav notify-row" id="top_menu">
                <!--  notification start -->
              
                <ul class="nav top-menu">
                    <{if isset($___weatherinfo)}>
                    <li class="dropdown">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
                            <i class="wi <{$___weatherinfo->weather_data[0]->dayPictureUrl}>"></i>
                            <span class="badge bg-theme">4</span>
                        </a>
                        <ul class="dropdown-menu extended">
                            <div class="notify-arrow notify-arrow-green"></div>
                             <li>
                                 <p class="green"><{$___weatherinfo->currentCity}>(天气)&nbsp;&nbsp;&nbsp;&nbsp;<span class="wi <{$___weatherinfo->weather_data[0]->dayPictureUrl}>"></span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="wi <{$___weatherinfo->weather_data[0]->nightPictureUrl}>"></span></p>
                            </li>
                            <li>
                                <a href="javascript:void(0);"><{$___weatherinfo->weather_data[0]->date}></a>
                            </li>
                            <li>
                                <a href="javascript:void(0);"><span class="wi wi-horizon-alt"></span>气温:<{$___weatherinfo->weather_data[0]->temperature}></a>
                            </li>
                            <li>
                                <a href="javascript:void(0);"><span class="wi wi-cloud"></span>天气:<{$___weatherinfo->weather_data[0]->weather}></a>
                            </li>
                             <li>
                                 <a href="javascript:void(0);"><span class="wi wi-day-windy"></span>风力:<{$___weatherinfo->weather_data[0]->wind}></a>
                            </li>
                        </ul>
                    </li>
                    <!-- inbox dropdown end -->
                     <{/if}>
                    <!--站内信-->
                    <li id="header_inbox_bar" class="dropdown">
                        <a class="dropdown-toggle" id="sendmessagebtn" data-toggle="dropdown">
                            <i class="fa fa-envelope"></i>
                            <span class="badge bg-theme send_message_count"><{$sendcount}></span>
                        </a>
                        <ul class="dropdown-menu extended inbox" id="messagelist">
                            <div class="notify-arrow notify-arrow-green"></div>
                            <li>
                                <p class="green">您已发送<span class="send_message_count"><{$sendcount}></span>条信息</p>
                            </li>
                            <{if $mlist}>
                            <{foreach $mlist as $vl}>
<li>
<a data-toggle="modal" data-id="<{$vl["id"]}>" data-type="showonly" data-target="#ajaxshowmessage">
    <span class="photo"><img alt="avatar" src="<{$vl["thumb"]}>"></span>
<span class="subject">
<span class="from">发给<{$vl["to_base_name"]}></span>
<span class="time"><{echo Common::Time_Tran($vl["create_time"]);}></span>
</span>
<span class="message">
<{$vl["title"]}>
</span>
</a>
</li>
<{/foreach}>   
<{/if}>
                            <li class="text-center">
                                <button class="btn btn-primary" data-toggle="modal" data-uid="<{$tenant["id"]}>" data-uname="<{$tenant["user_name"]}>" data-target="#sendmessage"><i class="fa fa-envelope"></i><span class="padding_left_right">站内信</span></button>
                            
                            </li>
                        </ul>
                    </li>
                    
                     <!--收件信-->
                    <li id="revcli" class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-envelope-o"></i>
                            <span class="badge bg-theme revc_message_count"><{$revcount}></span>
                        </a>
                        <ul class="dropdown-menu extended inbox" id="revmessagelist">
                            <div class="notify-arrow notify-arrow-green"></div>
                            <li>
                                <p class="green">您已收到<span class="send_message_count"><{$revcount}></span>条信息</p>
                            </li>
    <{if $mlist2}>
                            <{foreach $mlist2 as $v}>
                            <li class="<{if $v["is_read"]}>read<{else}>noread<{/if}>">
<a data-toggle="modal" data-id="<{$v["id"]}>" data-type="show" data-target="#ajaxshowmessage">
    <span class="photo"><img alt="avatar" src="<{$v["thumb"]}>"></span>
<span class="subject">
<span class="from">@<{$v["from_base_name"]}></span>
<span class="time"><{echo Common::Time_Tran($v["create_time"]);}></span>
</span>
<span class="message">
<{$v["title"]}>
</span>
</a>
</li>
<{/foreach}>   
<{/if}>
<li>
 <a href="<{echo Common::RewriteUrl("Tenantadmin","recvlist");}>">查看更多</a>
</li>
                        </ul>
                        
                        
                    </li>
                    
                    
                    
                    
                    
                </ul>
               
                <!--  notification end -->
            </div>
            <div class="top-menu">
            	<ul class="nav pull-right top-menu">
                    <li><a class="logout" href="<{echo Common::RewriteUrl("Tenantadmin","logout");}>">退出</a></li>
            	</ul>
            </div>
        </header>
      <!--header end-->
      
<{Tinclude "commom/ajax_send_message"}>
<{Tinclude "commom/ajax_show_message"}> 
      
      
      <script>
          function show_message_count(count){
              $(".send_message_count").html(count);
              $.post("<{echo Common::RewriteUrl("SendMessage","public_ajax_sendlist");}>",function(data){
                  $("#messagelist").html(data);
                  var btn=$("#sendmessagebtn");
                  btn.dropdown('toggle');
                  window.setTimeout(function(){btn.dropdown('toggle');},3000);
                  
              });
          }
          function recv_message(){
              $.post("<{echo Common::RewriteUrl("SendMessage","public_ajax_revclist");}>",function(data){
                  $("#revmessagelist").html(data);
                  var oldval=parseInt($(".revc_message_count").html());
                  var newval=parseInt($(".irevc_message_count").html());
                  $(".revc_message_count").html($(".irevc_message_count").html());
                  if(oldval!=newval){
                  $(".revc_message_count").fadeOut();
                  $(".revc_message_count").fadeIn();
                  $(".revc_message_count").fadeOut();
                  $(".revc_message_count").fadeIn();
                  $(".revc_message_count").fadeOut();
                  $(".revc_message_count").fadeIn();
                }
              });
          }
        $(document).ready(function () {
            window.setInterval(recv_message,20000);
            /*
        var unique_id = $.gritter.add({
            // (string | mandatory) the heading of the notification
            title: "欢迎登录(<{$tenant["base_name"]}>)",
            // (string | mandatory) the text inside the notification
            text: "<{if $tenant["is_third"]===1}>您使用第三方登录,建议您修改自己的信息,以方便下次登录.<br/><{/if}>上次登录时间<{echo date("Y-m-d H:i:s",$tenant["last_login_time"]);}>",
            // (string | optional) the image to display on the left
            image: "<{$tenant["thumb"]}>",
            // (bool | optional) if you want it to fade out on its own or just sit there
            sticky: false,
            // (int | optional) the time you want it to be alive for before fading out
            time: 3000,
            // (string | optional) the class name you want to apply to that specific message
            class_name: 'my-sticky-class'
        });
*/
        return false;
        });
      </script>